package test6;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-11-01
 * Time: 18:07
 */
class Cube implements Container{
    private double len;

    public Cube(double len) {
        this.len = len;
    }

    @Override
    public double area() {
        return 6*len*len;
    }

    @Override
    public double volume() {
        return len*len*len;
    }
}
class Cylinder implements Container {
    private double radius;
    private double h;

    public Cylinder(double radius, double h) {
        this.radius = radius;
        this.h = h;
    }

    @Override
    public double area() {
        return (radius*radius*pi*2) + (2*pi*radius*h);
    }

    @Override
    public double volume() {
        return radius*radius*pi*h;
    }
}

